load("@rules_proto//proto:defs.bzl", "proto_library")
load("@rules_proto_grpc_python//:defs.bzl", "python_grpc_library")
load("@rules_python//python:defs.bzl", "py_test")

package(default_visibility = ["//visibility:private"])

# Test that outputs are correctly predicted for python and grpc plugin when using proto
# files in paths with dots, which are converted to slashes by the python
# protoc plugin but kept in the grpc plugin.
# See https://github.com/protocolbuffers/protobuf/blob/v21.7/src/google/protobuf/compiler/python/helpers.cc#L95

proto_library(
    name = "proto_lib",
    srcs = ["path.dots/demo.proto"],
)

python_grpc_library(
    name = "py_lib",
    protos = ["proto_lib"],
)

py_test(
    name = "test",
    srcs = ["main.py"],
    main = "main.py",
    deps = ["py_lib"],
)
